#ifndef MASTER_OBSERVE_H
#define MASTER_OBSERVE_H

#include "master.h"
#include "slave.h"

enum RoleSwitch{
    ROLE_NONE,
    ROLE_MASTER,
    ROLE_SLAVE
};

class Observe{
private:
    Master master;
    Slave slave;
    RoleSwitch roleSwitch = ROLE_NONE;  //扮演的主从角色
    Observe() = default;

public:
    // 单例变量
    static Observe* Instance;

    // 获取单例变量
    static Observe* getInstance(){
        if(Instance == nullptr){
            Instance = new Observe();
        }
        return Instance;
    }

    // 运行主面板逻辑
    void run_master();

    // 运行从面板逻辑
    void run_slave();

};





#endif